#pragma once

#include <gofcl_usbfs_r.h>

typedef struct {
	u32_s : 16;
	u32_s PWRON : 1;
	u32_s : 1;
	u32_s VBUSACEN : 1;
	u32_s VBUSBCEN : 1;
	u32_s SOFOEN : 1;
	u32_s VBUSIG : 1;
	u32_s : 10;
} usbfs_gccfg_s;

_Static_assert(sizeof(usbfs_gccfg_s) == 4,
	       "Struct usbfs_gccfg_s defined error!");

static inline void usbfs_wreg_gccfg_s(usbfs_gccfg_s gccfg) {
	union {
		usbfs_gccfg_s g;
		u32_s u;
	} gu = {
		.g = gccfg,
	};
	usbfs_wreg(USBFS_GCCFG_R, gu.u);
}
